@using BlazorApp.Pages.Common
@using BlazorApp.Pages.Common.Html
@using BlazorApp.Pages.Common.Html.HTable
@using BlazorApp.Pages.Common.Metadata
@using BlazorApp.Pages.Container
@using k8s.Models
@inherits BlazorApp.Pages.Common.PageBase
<HTable Bordered Column="1">
    @if (PodSpec.HostAliases != null)
    {
        <HTableColumn Title=@L["HostAliases"] ExplainField="pod.spec.hostAliases">
            @foreach (var alias in PodSpec.HostAliases)
            {
                @foreach (var hostname in alias.Hostnames)
                {
                    <div>
                        <ColorfulTag >@($"{alias.Ip} {hostname}")</ColorfulTag>
                    </div>
                }
            }
        </HTableColumn>
    }
    <SelectorView Title=@L["NodeSelector"] Selector="@PodSpec.NodeSelector"
                  ExplainField="pod.spec.nodeSelector">
    </SelectorView>
    <PropertySimpleView Title=@L["ActiveDeadlineSeconds"] ExplainField="pod.spec.activeDeadlineSeconds" Item="@PodSpec.ActiveDeadlineSeconds"></PropertySimpleView>
    <PropertySimpleView Title=@L["EnableServiceLinks"] ExplainField="pod.spec.enableServiceLinks" Item="@PodSpec.EnableServiceLinks"></PropertySimpleView>
    <PropertySimpleView Title=@L["DnsConfig"] ExplainField="pod.spec.dnsConfig" Item="@PodSpec.DnsConfig" ShowInJson="true"></PropertySimpleView>
    <PropertyOptionView Title=@L["DnsPolicy"] Item="@PodSpec.DnsPolicy" Options='@(new[] { "Default", "ClusterFirst", "ClusterFirstWithHostNet", "None" })' ExplainField="pod.spec.dnsPolicy"></PropertyOptionView>
    <PropertyOptionView Title=@L["RestartPolicy"] Item="@PodSpec.RestartPolicy" Options='@(new[] { "Always", "Never", "OnFailure" })' ExplainField="pod.spec.restartPolicy"></PropertyOptionView>
    <PropertySimpleView Title=@L["AutomountServiceAccountToken"] ExplainField="pod.spec.automountServiceAccountToken" Item="@PodSpec.AutomountServiceAccountToken"></PropertySimpleView>
    <PropertySimpleView Title=@L["HostIPC"] ExplainField="pod.spec.hostIPC" Item="@PodSpec.HostIPC"></PropertySimpleView>
    <PropertySimpleView Title=@L["HostNetwork"] ExplainField="pod.spec.hostNetwork" Item="@PodSpec.HostNetwork"></PropertySimpleView>
    <PropertySimpleView Title=@L["HostPID"] ExplainField="pod.spec.hostPID" Item="@PodSpec.HostPID"></PropertySimpleView>
    <PropertySimpleView Title=@L["HostUsers"] ExplainField="pod.spec.hostUsers" Item="@PodSpec.HostUsers"></PropertySimpleView>
    <PropertySimpleView Title=@L["Hostname"] ExplainField="pod.spec.hostname" Item="@PodSpec.Hostname"></PropertySimpleView>
    <PropertySimpleView Title=@L["Subdomain"] ExplainField="pod.spec.subdomain" Item="@PodSpec.Subdomain"></PropertySimpleView>
    <PropertySimpleGenericsView Title=@L["Os"] ExplainField="pod.spec.os" Item="@PodSpec.Os" Key="Name" T="V1PodOS"></PropertySimpleGenericsView>
    <PropertySimpleView Title=@L["NodeName"] ExplainField="pod.spec.nodeName" Item="@PodSpec.NodeName" OnClick="@(() => OnNodeNameClick(PodSpec.NodeName))"></PropertySimpleView>
    <PropertySimpleView Title=@L["SchedulerName"] Item="@PodSpec.SchedulerName" ExplainField="pod.spec.schedulerName"></PropertySimpleView>
    <PropertyListView Title=@L["SchedulingGates"] Items="@PodSpec.SchedulingGates" Key="Name" ExplainField="pod.spec.schedulingGates" T="V1PodSchedulingGate"></PropertyListView>
    <PropertySimpleView Title=@L["RuntimeClassName"] Item="@PodSpec.RuntimeClassName" ExplainField="pod.spec.runtimeClassName"></PropertySimpleView>
    <PropertySimpleView Title=@L["PriorityClass"] Item="@PodSpec.PriorityClassName" ExplainField="pod.spec.priorityClassName"></PropertySimpleView>
    <PropertySimpleView Title=@L["Priority"] Item="@PodSpec.Priority" ExplainField="pod.spec.priority"></PropertySimpleView>
    <PropertyListView Title=@L["ImagePullSecrets"] Items="@PodSpec.ImagePullSecrets" Key="Name" ExplainField="pod.spec.imagePullSecrets" T="V1LocalObjectReference"></PropertyListView>
    <PropertyOptionView Title=@L["PreemptionPolicy"] ExplainField="pod.spec.preemptionPolicy" Item="@PodSpec.PreemptionPolicy" Options='@(new[] { "Never", "PreemptLowerPriority" })'></PropertyOptionView>
    <PropertySimpleView Title=@L["Overhead"] Item="@PodSpec.Overhead" ExplainField="pod.spec.overhead" ShowInJson="true"></PropertySimpleView>
    <PropertySimpleView Title=@L["ResourceClaims"] Item="@PodSpec.ResourceClaims" ExplainField="pod.spec.resourceClaims" ShowInJson="true"></PropertySimpleView>
    <PropertyListView Title=@L["ReadinessGates"] ExplainField="pod.spec.readinessGates" Items="@PodSpec.ReadinessGates" Key="ConditionType" T="V1PodReadinessGate"></PropertyListView>
    <PropertySimpleView Title=@L["ServiceAccount"] ExplainField="pod.spec.serviceAccount" Item="@PodSpec.ServiceAccount"></PropertySimpleView>
    <PropertySimpleView Title=@L["ServiceAccountName"] ExplainField="pod.spec.serviceAccountName" Item="@PodSpec.ServiceAccountName"></PropertySimpleView>
    <PropertySimpleView Title=@L["SetHostnameAsFQDN"] ExplainField="pod.spec.setHostnameAsFQDN" Item="@PodSpec.SetHostnameAsFQDN"></PropertySimpleView>
    <PropertySimpleView Title=@L["ShareProcessNamespace"] ExplainField="pod.spec.shareProcessNamespace" Item="@PodSpec.ShareProcessNamespace"></PropertySimpleView>
    <PropertySimpleView Title=@L["TerminationGracePeriodSeconds"] ExplainField="pod.spec.terminationGracePeriodSeconds" Item="@PodSpec.TerminationGracePeriodSeconds"></PropertySimpleView>
    <PropertySimpleView Title=@L["TopologySpreadConstraints"] ExplainField="pod.spec.topologySpreadConstraints" Item="@PodSpec.TopologySpreadConstraints"></PropertySimpleView>
    <ImagesView PodSpec="@PodSpec"></ImagesView>
    <PodAffinityView ExplainField="pod.spec.affinity" Affinity="@PodSpec.Affinity"></PodAffinityView>
    <TolerationsView ExplainField="pod.spec.tolerations" Tolerations="@PodSpec.Tolerations"></TolerationsView>
</HTable>

<PodSecurityContextView PodSecurityContext="@PodSpec.SecurityContext"></PodSecurityContextView>

<ContainerSpecListView PodSpec="@PodSpec" OnPortForward="OnPortForward" ShowPortForwardBtn="@(PodName != null && PodNamespace != null)"></ContainerSpecListView>

<VolumeView PodSpec="@PodSpec" Namespace="@PodNamespace"></VolumeView>
